package com.chenju.invokechainservice.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class EnableAOPAspect {

//    @Pointcut("execution(* com.chenju.invokechainservice..*.*(..))")
    @Pointcut("@annotation(com.chenju.invokechainservice.annotation.EnableAOP)")
    public void pointcut(){}

    @Before("pointcut()")
    public void beforeMethod(){
        System.out.println("前置");
    }

    @After("pointcut()")
    public void afterMethod(){
        System.out.println("后置");
    }
}
